home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / patches / _winfile / lw42w2 / installr.bat < prev    next >
DOS Batch File  |  1996-07-10  |  5KB  |  194 lines

  1. @echo off
  2. rem $Id: installr.bat 1.4 95/03/28 15:40:19 frotz Exp $
  3. rem $Source: h:/prod/lwp/patches/rcs/installr.bat $
  4. rem $Locker:  $
  5.  
  6. rem
  7. rem    Specify which patch name and which signature file here:    
  8. rem
  9. set _mod=LW42W
  10. set _rev=2
  11. set _file=lwpcon.exe
  12. set _r=n
  13. rem
  14.  
  15. echo.
  16. echo.    %0:  LAN WorkPlace for DOS 4.2 and 4.1 patch installer:  %_mod% (Rev %_rev%)
  17. echo.    (C) Copyright 1995 Novell, Inc.  All Rights Reserved.
  18. echo.
  19.  
  20. :MAIN
  21. rem
  22. rem    WARNING:  This must be invoked from the current directory.
  23. rem
  24. set ME=%0
  25.  
  26. set usage=%me% [/h] [/p] [/r] [/d dir]
  27. if  (%_r%)==(y)    set usage=%me% [/h] [/p] [/r] /d dir
  28. if  (%_r%)==(y)    if  (%1)==()    goto USAGE
  29.  
  30. if  (%1)==(-h)    goto USAGE
  31. if  (%1)==(-H)    goto USAGE
  32. if  (%1)==(/h)    goto USAGE
  33. if  (%1)==(/H)    goto USAGE
  34. if  (%1)==(/?)    goto USAGE
  35. if  (%1)==(-?)    goto USAGE
  36. if  (%1)==(-p)    set install_opt=/P
  37. if  (%1)==(/p)    set install_opt=/P
  38. if  (%1)==(-P)    set install_opt=/P
  39. if  (%1)==(/P)    set install_opt=/P
  40. if  (%1)==(-p)    shift
  41. if  (%1)==(/p)    shift
  42. if  (%1)==(-P)    shift
  43. if  (%1)==(/P)    shift
  44. if  (%1)==(/d)    set dir=%2
  45. if  (%1)==(-d)    set dir=%2
  46. if  (%1)==(/D)    set dir=%2
  47. if  (%1)==(-D)    set dir=%2
  48. if  (%1)==(/r)    set _readme=more
  49. if  (%1)==(-r)    set _readme=more
  50. if  (%1)==(/R)    set _readme=more
  51. if  (%1)==(-R)    set _readme=more
  52. if  (%_r%)==(y)    goto INSTALL
  53. if  not exist which.exe    goto USAGE
  54. goto INSTALL
  55.  
  56.  
  57.  
  58.  
  59. :USAGE
  60. echo.
  61. echo. %me% usage:
  62. echo. %usage%
  63. echo.
  64. echo. where:
  65. echo.    /h    Displays this information.
  66. echo.    /r    View the %_mod%.TXT file after installing.
  67. echo.    /p    Prompts user before adding/replacing each file.
  68. echo.    dir    Optionally specifies the directory to be upgraded.
  69. echo.
  70. echo. NOTE: This batch file requires the DOS command REPLACE.EXE.
  71. if  (%_r%)==(y)    goto WARNING
  72.  
  73. echo. The command WHICH.EXE will attempt to find the correct directory
  74. echo. and MUST be in the current directory.
  75. echo.
  76.  
  77. :WARNING
  78. echo. WARNING: This batch file requires an environment size of 1024 or more.
  79. echo.          Add this line to CONFIG.SYS to ensure proper execution.
  80. echo.          SHELL=C:\MSDOS\6\COMMAND.COM C:\ /E:2048 /P
  81. echo.
  82. goto end
  83.  
  84.  
  85.  
  86.  
  87. :INSTALL
  88. echo. WARNING:  This installation batch file expects to install into
  89. echo.           the normal directory tree for this product.  
  90. echo.
  91. echo.           If this installation fails, apply each file by hand.
  92. echo.           SHELL=C:\MSDOS\COMMAND.COM C:\ /E:2048 /P  is highly recommended.
  93. pause
  94. if  (%dir%)==()    goto APPLY
  95. set old_path=%path%
  96. if  not (%old_path%)==(%path%)    goto ERROR1
  97. set path=%dir%;%path%
  98. echo. %me%: PATH temporarily forced to %path%.
  99. goto APPLY
  100.  
  101.  
  102.  
  103.  
  104. :ERROR1
  105. echo. %me% FATAL ERROR.  Out of environment space.
  106. goto USAGE
  107.  
  108.  
  109.  
  110.  
  111. :APPLY
  112. rem
  113. rem    1) Find which directory and create a batch file...
  114. rem
  115. set _tmp=%temp%
  116. if  (%_tmp%)==()    set _tmp=c:
  117. which /b %_tmp%\ptch_tmp.bat %_file%
  118. echo.
  119.  
  120. rem
  121. rem    2) Invoke that batch file to find the target directory.
  122. rem       Stored in the Environment Variable:  _TMP_PATH_.
  123. rem
  124. if  exist %_tmp%\ptch_tmp.bat    call %_tmp%\ptch_tmp.bat
  125. if  exist %_tmp%\ptch_tmp.bat    del  %_tmp%\ptch_tmp.bat
  126. set _tmp=.
  127. if  exist %_tmp%\ptch_tmp.bat    call %_tmp%\ptch_tmp.bat
  128. if  exist %_tmp%\ptch_tmp.bat    del  %_tmp%\ptch_tmp.bat
  129. set _tmp=
  130.  
  131. rem
  132. rem    3) Now add any missing files.
  133. rem
  134. cd .
  135. echo. %me%: Updating %_tmp_path_%
  136. replace /u %install_opt% *.* %_tmp_path_%
  137. replace /a %install_opt% *.* %_tmp_path_%
  138. cd .
  139.  
  140. rem
  141. rem    4) Don't copy the PATCH compressed file.  Go back and delete it.
  142. rem
  143. echo. %me%: REPLACE copied the self-extract patch file.  Now undoing that...
  144. if  exist %_tmp_path_%\%_mod%.exe    attrib -r %_tmp_path_%\%_mod%.exe
  145. if  exist %_tmp_path_%\%_mod%.zip    attrib -r %_tmp_path_%\%_mod%.zip
  146. if  exist %_tmp_path_%\%_mod%.exe    del %_tmp_path_%\%_mod%.exe
  147. if  exist %_tmp_path_%\%_mod%.zip    del %_tmp_path_%\%_mod%.zip
  148.  
  149. rem
  150. rem    Remove local files that will never appear in the field...
  151. rem
  152. if  exist %_tmp_path_%\0index.htm    attrib -r %_tmp_path_%\0index.htm
  153. if  exist %_tmp_path_%\0index.txt    attrib -r %_tmp_path_%\0index.txt
  154. if  exist %_tmp_path_%\0index.stp    attrib -r %_tmp_path_%\0index.stp
  155. if  exist %_tmp_path_%\0index.lst    attrib -r %_tmp_path_%\0index.lst
  156. if  exist %_tmp_path_%\0index.htm    del %_tmp_path_%\0index.htm
  157. if  exist %_tmp_path_%\0index.txt    del %_tmp_path_%\0index.txt
  158. if  exist %_tmp_path_%\0index.stp    del %_tmp_path_%\0index.stp
  159. if  exist %_tmp_path_%\0index.lst    del %_tmp_path_%\0index.lst
  160.  
  161. rem
  162. rem    5) Clean up...
  163. rem
  164. if  not (%dir%)==()    set path=%old_path%
  165. if  not (%dir%)==()    echo. %me%: PATH reset to %path%.
  166. echo. %me%: %_mod% installation completed.
  167. echo. %me%: NOTE: National language files not installed.
  168. DIR .\LANG
  169.  
  170. rem
  171. rem    6) Now read the README...
  172. rem       NOTE:  MORE must be on the path.
  173. rem
  174. if  (%_readme%)==()    goto END
  175. more < %_mod%.TXT
  176. goto END
  177.  
  178.  
  179.  
  180.  
  181. :end
  182. set _tmp_path_=
  183. set osver=
  184. set dir=
  185. set old_path=
  186. set me=
  187. set install_opt=
  188. set _mod=
  189. set _file=
  190. set usage=
  191. set _r=
  192. set _readme=
  193. set _rev=
  194.